﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IAccountManager.cs" company="Concept Architecture">
//   (c) 2010 Muhammad Umer Farooq
// </copyright>
// <summary>
//   Defines the <seealso cref="Hisaab.Business.Interfaces.IAccountManager" /> interface.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Hisaab.Business.Interfaces
{
    using System.Collections.Generic;
    using Common;
    using Entities;

    /// <summary>
    /// Defines the <seealso cref="Hisaab.Business.Interfaces.IAccountManager"/> interface.
    /// </summary>
    public interface IAccountManager : IManagerBase<Account>
    {
        /// <summary>
        /// Gets the by userId.
        /// </summary>
        /// <param name="id">The account userId.</param>
        /// <returns>Account matching account userId</returns>
        Account GetById(int id);

        /// <summary>
        /// Gets the name of the by.
        /// </summary>
        /// <param name="name">The name of account to get</param>
        /// <returns>Account matching name</returns>
        Account GetByName(string name);

        /// <summary>
        /// Gets the account summary.
        /// </summary>
        /// <param name="id">The account userId</param>
        /// <param name="userId">The caller user userId</param>
        /// <returns>Account summary object</returns>
        AccountSummary GetAccountSummary(int id, int userId);

        /// <summary>
        /// Gets the account balance.
        /// </summary>
        /// <param name="id">The userId of account to get balance for</param>
        /// <returns>Closing balance of account</returns>
        decimal GetAccountBalance(int id);

        /// <summary>
        /// Gets the monthly balance summary.
        /// </summary>
        /// <param name="accountId">The account userId.</param>
        /// <param name="userId">The calling user id</param>
        /// <returns>
        /// List of month and balance
        /// </returns>
        IEnumerable<AccountMonthlyTotal> GetMonthlyBalanceSummary(int accountId, int userId);

        /// <summary>
        /// Gets the account totals.
        /// </summary>
        /// <param name="userId">The calling user id</param>
        /// <returns>List of account totals and summary</returns>
        IEnumerable<KeyValue<Account, decimal>> GetAccountTotals(int userId);

        /// <summary>
        /// Gets all account balance.
        /// </summary>
        /// <param name="userId">The calling user id</param>
        /// <returns>Return list of accounts and all of their monthly totals</returns>
        IEnumerable<KeyValue<Account, IEnumerable<AccountMonthlyTotal>>> GetAllAccountBalance(int userId);
    }
}